.TH "QwtPlotCanvas" 3 "Sun Jul 18 2021" "Version 6.2.0" "Qwt User's Guide" \" -*- nroff -*-
.ad l
.nh
.SH NAME
QwtPlotCanvas \- Canvas of a \fBQwtPlot\fP\&.  

.SH SYNOPSIS
.br
.PP
.PP
\fC#include <qwt_plot_canvas\&.h>\fP
.PP
Inherits QFrame, and \fBQwtPlotAbstractCanvas\fP\&.
.SS "Public Types"

.in +1c
.ti -1c
.RI "enum \fBPaintAttribute\fP { \fBBackingStore\fP = 1, \fBOpaque\fP = 2, \fBHackStyledBackground\fP = 4, \fBImmediatePaint\fP = 8 }"
.br
.RI "Paint attributes\&. "
.ti -1c
.RI "typedef QFlags< \fBPaintAttribute\fP > \fBPaintAttributes\fP"
.br
.in -1c
.SS "Public Slots"

.in +1c
.ti -1c
.RI "void \fBreplot\fP ()"
.br
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBQwtPlotCanvas\fP (\fBQwtPlot\fP *=NULL)"
.br
.RI "Constructor\&. "
.ti -1c
.RI "virtual \fB~QwtPlotCanvas\fP ()"
.br
.RI "Destructor\&. "
.ti -1c
.RI "void \fBsetPaintAttribute\fP (\fBPaintAttribute\fP, bool on=true)"
.br
.RI "Changing the paint attributes\&. "
.ti -1c
.RI "bool \fBtestPaintAttribute\fP (\fBPaintAttribute\fP) const"
.br
.ti -1c
.RI "const QPixmap * \fBbackingStore\fP () const"
.br
.ti -1c
.RI "Q_INVOKABLE void \fBinvalidateBackingStore\fP ()"
.br
.RI "Invalidate the internal backing store\&. "
.ti -1c
.RI "virtual bool \fBevent\fP (QEvent *) override"
.br
.ti -1c
.RI "Q_INVOKABLE QPainterPath \fBborderPath\fP (const QRect &) const"
.br
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "virtual void \fBpaintEvent\fP (QPaintEvent *) override"
.br
.ti -1c
.RI "virtual void \fBresizeEvent\fP (QResizeEvent *) override"
.br
.ti -1c
.RI "virtual void \fBdrawBorder\fP (QPainter *) override"
.br
.in -1c
.SH "Detailed Description"
.PP 
Canvas of a \fBQwtPlot\fP\&. 

Canvas is the widget where all plot items are displayed
.PP
\fBSee also\fP
.RS 4
\fBQwtPlot::setCanvas()\fP, \fBQwtPlotGLCanvas\fP, \fBQwtPlotOpenGLCanvas\fP 
.RE
.PP

.PP
Definition at line 29 of file qwt_plot_canvas\&.h\&.
.SH "Member Typedef Documentation"
.PP 
.SS "typedef QFlags<\fBPaintAttribute\fP > \fBQwtPlotCanvas::PaintAttributes\fP"
An ORed combination of \fBPaintAttribute\fP values\&. 
.PP
Definition at line 102 of file qwt_plot_canvas\&.h\&.
.SH "Member Enumeration Documentation"
.PP 
.SS "enum \fBQwtPlotCanvas::PaintAttribute\fP"

.PP
Paint attributes\&. The default setting enables BackingStore and Opaque\&.
.PP
\fBSee also\fP
.RS 4
\fBsetPaintAttribute()\fP, \fBtestPaintAttribute()\fP 
.RE
.PP

.PP
\fBEnumerator\fP
.in +1c
.TP
\fB\fIBackingStore \fP\fP
Paint double buffered reusing the content of the pixmap buffer when possible\&. Using a backing store might improve the performance significantly, when working with widget overlays ( like rubber bands )\&. Disabling the cache might improve the performance for incremental paints (using \fBQwtPlotDirectPainter\fP )\&.
.PP
\fBSee also\fP
.RS 4
\fBbackingStore()\fP, \fBinvalidateBackingStore()\fP 
.RE
.PP

.TP
\fB\fIOpaque \fP\fP
Try to fill the complete contents rectangle of the plot canvas\&. When using styled backgrounds Qt assumes, that the canvas doesn't fill its area completely ( f\&.e because of rounded borders ) and fills the area below the canvas\&. When this is done with gradients it might result in a serious performance bottleneck - depending on the size\&.
.PP
When the Opaque attribute is enabled the canvas tries to identify the gaps with some heuristics and to fill those only\&.
.PP
\fBWarning\fP
.RS 4
Will not work for semitransparent backgrounds 
.RE
.PP

.TP
\fB\fIHackStyledBackground \fP\fP
Try to improve painting of styled backgrounds\&. \fBQwtPlotCanvas\fP supports the box model attributes for customizing the layout with style sheets\&. Unfortunately the design of Qt style sheets has no concept how to handle backgrounds with rounded corners - beside of padding\&.
.PP
When HackStyledBackground is enabled the plot canvas tries to separate the background from the background border by reverse engineering to paint the background before and the border after the plot items\&. In this order the border gets perfectly antialiased and you can avoid some pixel artifacts in the corners\&. 
.TP
\fB\fIImmediatePaint \fP\fP
When ImmediatePaint is set \fBreplot()\fP calls repaint() instead of update()\&.
.PP
\fBSee also\fP
.RS 4
\fBreplot()\fP, QWidget::repaint(), QWidget::update() 
.RE
.PP

.PP
Definition at line 44 of file qwt_plot_canvas\&.h\&.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "QwtPlotCanvas::QwtPlotCanvas (\fBQwtPlot\fP * plot = \fCNULL\fP)\fC [explicit]\fP"

.PP
Constructor\&. 
.PP
\fBParameters\fP
.RS 4
\fIplot\fP Parent plot widget 
.RE
.PP
\fBSee also\fP
.RS 4
\fBQwtPlot::setCanvas()\fP 
.RE
.PP

.PP
Definition at line 41 of file qwt_plot_canvas\&.cpp\&.
.SH "Member Function Documentation"
.PP 
.SS "const QPixmap * QwtPlotCanvas::backingStore () const"

.PP
\fBReturns\fP
.RS 4
Backing store, might be null 
.RE
.PP

.PP
Definition at line 133 of file qwt_plot_canvas\&.cpp\&.
.SS "QPainterPath QwtPlotCanvas::borderPath (const QRect & rect) const"
Calculate the painter path for a styled or rounded border
.PP
When the canvas has no styled background or rounded borders the painter path is empty\&.
.PP
\fBParameters\fP
.RS 4
\fIrect\fP Bounding rectangle of the canvas 
.RE
.PP
\fBReturns\fP
.RS 4
Painter path, that can be used for clipping 
.RE
.PP

.PP
Definition at line 320 of file qwt_plot_canvas\&.cpp\&.
.SS "void QwtPlotCanvas::drawBorder (QPainter * painter)\fC [override]\fP, \fC [protected]\fP, \fC [virtual]\fP"
Draw the border of the plot canvas
.PP
\fBParameters\fP
.RS 4
\fIpainter\fP Painter 
.RE
.PP
\fBSee also\fP
.RS 4
\fBsetBorderRadius()\fP 
.RE
.PP

.PP
Reimplemented from \fBQwtPlotAbstractCanvas\fP\&.
.PP
Definition at line 276 of file qwt_plot_canvas\&.cpp\&.
.SS "bool QwtPlotCanvas::event (QEvent * event)\fC [override]\fP, \fC [virtual]\fP"
Qt event handler for QEvent::PolishRequest and QEvent::StyleChange
.PP
\fBParameters\fP
.RS 4
\fIevent\fP Qt Event 
.RE
.PP
\fBReturns\fP
.RS 4
See QFrame::event() 
.RE
.PP

.PP
Definition at line 151 of file qwt_plot_canvas\&.cpp\&.
.SS "void QwtPlotCanvas::paintEvent (QPaintEvent * event)\fC [override]\fP, \fC [protected]\fP, \fC [virtual]\fP"
Paint event 
.PP
\fBParameters\fP
.RS 4
\fIevent\fP Paint event 
.RE
.PP

.PP
Definition at line 178 of file qwt_plot_canvas\&.cpp\&.
.SS "void QwtPlotCanvas::replot ()\fC [slot]\fP"
Invalidate the paint cache and repaint the canvas 
.PP
\fBSee also\fP
.RS 4
invalidatePaintCache() 
.RE
.PP

.PP
Definition at line 301 of file qwt_plot_canvas\&.cpp\&.
.SS "void QwtPlotCanvas::resizeEvent (QResizeEvent * event)\fC [override]\fP, \fC [protected]\fP, \fC [virtual]\fP"
Resize event 
.PP
\fBParameters\fP
.RS 4
\fIevent\fP Resize event 
.RE
.PP

.PP
Definition at line 291 of file qwt_plot_canvas\&.cpp\&.
.SS "void QwtPlotCanvas::setPaintAttribute (\fBPaintAttribute\fP attribute, bool on = \fCtrue\fP)"

.PP
Changing the paint attributes\&. 
.PP
\fBParameters\fP
.RS 4
\fIattribute\fP Paint attribute 
.br
\fIon\fP On/Off
.RE
.PP
\fBSee also\fP
.RS 4
\fBtestPaintAttribute()\fP, \fBbackingStore()\fP 
.RE
.PP

.PP
Definition at line 70 of file qwt_plot_canvas\&.cpp\&.
.SS "bool QwtPlotCanvas::testPaintAttribute (\fBPaintAttribute\fP attribute) const"
Test whether a paint attribute is enabled
.PP
\fBParameters\fP
.RS 4
\fIattribute\fP Paint attribute 
.RE
.PP
\fBReturns\fP
.RS 4
true, when attribute is enabled 
.RE
.PP
\fBSee also\fP
.RS 4
\fBsetPaintAttribute()\fP 
.RE
.PP

.PP
Definition at line 127 of file qwt_plot_canvas\&.cpp\&.

.SH "Author"
.PP 
Generated automatically by Doxygen for Qwt User's Guide from the source code\&.
